const L_MSGTOOL = $.extend({

    //判断是否在时间前面加0
    getNow(s) {
        return s < 10 ? '0' + s : s;
    },
    //获取当前时间显示
    getDataTime() {
        let dates = new Date();
        let year = dates.getFullYear(); //获取当前年
        let month = dates.getMonth() + 1; //获取当前月
        let date = dates.getDate(); //获取当前日
        let h = dates.getHours(); //获取当前小时数(0-23)
        let m = dates.getMinutes(); //获取当前分钟数(0-59)
        let s = dates.getSeconds();
        return year + '-' + L_MSGTOOL.getNow(month) + "-" + L_MSGTOOL.getNow(date) + " " + L_MSGTOOL.getNow(h) + ':' + L_MSGTOOL.getNow(m) + ":" + L_MSGTOOL.getNow(s);
    },
    SetSpanVal() {
        let len = 0;
        for (let i = 0; i < $(".smallBell-msg-info-content").find(".msg-content").length; i++) {
            let title = $(".smallBell-msg-info-content").find(".msg-content").eq(i).attr("title");
            if (title == "未读") {
                len++;
            }
        }
        let spanVal = len;
        $(".tiaoShui").html($(".smallBell-msg-info-content").find(".msg-content").length);
        if (parseInt(spanVal) <= 0) {
            $(".smallBell-msg").attr("class", "visibilityHidden smallBell-msg");
            $(".tiaoShui").html(0);
        } else if (parseInt(spanVal) > 0 && parseInt(spanVal) < 10) {
            $(".smallBell-msg").attr("class", "visibilityShow smallBell-msg smallBell-msg-locat");
            $(".smallBell-msg").find("span").html("");
        } else if (parseInt(spanVal) > 9 && parseInt(spanVal) <= 99) {
            $(".smallBell-msg").attr("class", "visibilityShow smallBell-msg smallBell-msg-locats");
            $(".smallBell-msg").find("span").html(spanVal);
        } else if (parseInt(spanVal) > 99) {
            $(".smallBell-msg").attr("class", "visibilityShow smallBell-msg smallBell-msg-locats");
            $(".smallBell-msg").find("span").html("99+");
        }
    }
});